﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Gao.Poker.Domain;
using Gao.Poker.ViewModel;

namespace Gao.Poker.App.UserControls
{
    /// <summary>
    /// Interaction logic for GameTables.xaml
    /// </summary>
    public partial class GameTables : UserControl
    {
        protected GameTablesViewModel _ViewModel;

        public GameTables()
        {
            InitializeComponent();

            _ViewModel = new GameTablesViewModel {Message = OnMessage};
            DataContext = _ViewModel;
            btnNew.Click += New_Click;
        }

        private void New_Click(object sender, RoutedEventArgs e)
        {
            _ViewModel.Tables = new Tables();
        }

        private void OnMessage(string msg)
        {
            MessageBox.Show(msg, "提示信息");
        }
    }
}
